<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理后台 - API Key管理系统</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .loading-container {
            background: white;
            border-radius: 16px;
            padding: 40px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            text-align: center;
            max-width: 400px;
        }
        
        .loading-title {
            font-size: 24px;
            font-weight: 600;
            color: #303133;
            margin-bottom: 16px;
        }
        
        .loading-text {
            color: #909399;
            margin-bottom: 20px;
        }
        
        .loading-link {
            color: #667eea;
            text-decoration: none;
            font-weight: 500;
        }
        
        .loading-link:hover {
            text-decoration: underline;
        }
        
        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f4f6;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 20px auto;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
    <script>
        // 检查路径并重定向到正确的管理页面
        const currentPath = window.location.pathname;
        
        // 如果访问的是 /admin 或 /admin/，重定向到管理后台主页
        if (currentPath === '/admin' || currentPath === '/admin/' || currentPath === '/admin/index.html') {
            setTimeout(() => {
                window.location.href = '/admin-dashboard.html';
            }, 1000);
        }
        // 如果访问的是其他 /admin/* 路径，根据具体路径重定向
        else if (currentPath.startsWith('/admin/')) {
            const adminPath = currentPath.replace('/admin/', '');
            
            // 根据路径映射到对应的页面
            const pathMapping = {
                'dashboard': '/admin-dashboard.html',
                'review': '/admin-dashboard.html#applications',
                'keys': '/admin-main.html',
                'logs': '/access-logs.html',
                'login': '/admin-login.html'
            };
            
            const targetPage = pathMapping[adminPath] || '/admin-dashboard.html';
            setTimeout(() => {
                window.location.href = targetPage;
            }, 1000);
        }
    </script>
</head>
<body>
    <div class="loading-container">
        <div class="spinner"></div>
        <h2 class="loading-title">正在跳转到管理后台...</h2>
        <p class="loading-text">如果页面没有自动跳转，请<a href="/admin-dashboard.html" class="loading-link">点击这里</a></p>
    </div>
</body>
</html>